package cn.ddiancan.xddcloud.ddccore.validator.annotation;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;

import cn.ddiancan.xddcloud.ddccore.validator.DateNotBeforeValidator;
import jakarta.validation.Constraint;
import jakarta.validation.Payload;

@Target({ElementType.METHOD, ElementType.FIELD, ElementType.ANNOTATION_TYPE, ElementType.PARAMETER, ElementType.TYPE})
@Retention(RetentionPolicy.RUNTIME)
@Constraint(validatedBy = DateNotBeforeValidator.class)
public @interface DateNotBefore {

    String sourceDate() default "";

    String targetDate() default "";

    String message() default "{sourceDate} can't be before the date of {targetDate}";

    Class<?>[] groups() default {};

    Class<? extends Payload>[] payload() default {};
}
